/**********************************************************
Filename: i2c-net.cpp
Author: Dave Frank (dnfrank@gmail.com)

**********************************************************/
#include <iostream>
#include "i2cDevice.h"

const unsigned char i2cDevice::NULL_DEVICE_ID=255;
const std::string i2cDevice::NULL_DEVICE_NAME="";
const i2cDevice i2cDevice::NULL_DEVICE(i2cDevice::NULL_DEVICE_NAME, i2cDevice::NULL_DEVICE_ID);

i2cDevice::i2cDevice():
m_name(i2cDevice::NULL_DEVICE_NAME),
m_id(i2cDevice::NULL_DEVICE_ID),
m_network(NULL)
{
}

i2cDevice::i2cDevice(const std::string& name,unsigned char id):
m_name(name),
m_id(id),
m_network(NULL)
{
}

i2cDevice::i2cDevice(const i2cDevice& dev):
m_name(dev.m_name),
m_id(dev.m_id),
m_network(NULL)
{
}

i2cDevice::~i2cDevice()
{
}

const std::string& i2cDevice::name() const
{
    return m_name;
}

i2cNet* i2cDevice::getNetwork()
{
    return m_network;
}

void  i2cDevice::operator=(const i2cDevice& dev) 
{
    m_name=dev.m_name;
    m_id=dev.m_id;
}

int i2cDevice::operator==(const i2cDevice& dev) const
{
    return (m_name==dev.m_name && m_id==dev.m_id);
}


int i2cDevice::operator!=(const i2cDevice& dev) const
{
    return !(*this==dev);
}
